class Solution:
    def removeOuterParentheses(self, s: str) -> str:
        ans, cnt = '', 0
        for  c in s:
            if c == ')':
                cnt -= 1
            if cnt > 0:
                ans += c
            if c == '(':
                cnt += 1
        return ans